In this lab, you will try to connect to a listener. The connection will fail. The goal is to try and identify the cause of the failure and fix the issue.
At the end of this lab, you will be able to:
30 minutes
Use the following credentials to login into virtual environment
Before starting the training module, we recommend that you launch the labs and give them some time to stabilize. Please be aware that sometimes the AG may be in a resolving state and AG Replicas may be in a disconnected state. This is a platform issue and should stabilize after a few minutes
Before you begin with the first exercise in the lab, let's review the lab environment.
In the lab, you have one Domain Controller and 3 nodes + 1 client computer.
AlwaysOnN1 and AlwaysOnN2 nodes are in the primary Datacenter.
AlwaysOnN3 is in the secondary datacenter.
For this lab, both the datacenters are in the same subnet.
Each node has Windows Server 2022 O/S installed.
SQL Server 2022 Standalone instances are installed on all the 3 nodes (i.e. AlwaysOnN1, AlwaysOnN2, AlwaysOnN3).
In this exercise, you will learn how to Connect to the listener.
Connect to the listener
In this task, you will use the SQL Server management studio to connect to a listener. Perform this task on the virtual machine AlwaysOnClient.
Open SSMS and Connect to AGCorpListen, this is the listener for the Availability Group deployed between AlwaysOnN1, AlwaysOnN2 and AlwaysOnN3 replicas for the database AdventureWorks. The connection will fail with the below error.
Feel free to connect to the listener again as you try various options to fix the issue.
You have successfully completed this exercise. Click Next to advance to the next exercise.
In this exercise, you will learn how to Identify the cause of the failure and fix the issue.
This is a non-guided activity and the attendees are expected to try and troubleshoot this issue on their own.
You can use any resources (including the internet or your own scripts), to troubleshoot the issue.
You can use the tools discussed in the first module to help troubleshoot the issue.
The possible causes discussed earlier in the lesson can be used as guidance for troubleshooting.
The instructor will discuss the troubleshooting steps, cause and solution in detail after this lab session.
You might have to login directly on the individual nodes to troubleshoot the issue.
Ask yourself the below questions:
Use some commands that could be used for troubleshooting the issue.
This is not a complete list of commands/tools to help troubleshoot this issue. There are various ways/methods/approaches to troubleshoot an issue. These commands/tools referenced here could be used to look up/identify useful information for this lab.
To verify whether the listener is online:
SQLSELECT * FROM sys.dm_tcp_listener_states;
To restart an offline listener:
SQLALTER AVAILABILITY GROUP AGCorp RESTART LISTENER 'AGCorpListen';
Some other helpful DMVs:
SQLselect dns_name,port,is_conformant,ip_configuration_string_from_cluster FROM sys.availability_group_listeners
To check SPN for the Listener (Run this from the command prompt on one of the replicas):
SQLSetspn -l corpnet\SQLsvc
To Add SPN for the Listener (Run this from the command prompt on one of the replicas):
CMDsetspn -A MSSQLSvc/AGCorpListen.corpnet.contoso.com:1433 corpnet\SQLSvc
AGCorpListen.corpnet.contoso.com is the AG listener FQDN and corpnet\SQLSvc is the logon account used by the SQL Service.
You have successfully completed this exercise. Click Next to advance to the next lab.